package services
{
   import mx.controls.Alert;
   import mx.messaging.ChannelSet;
   import mx.messaging.channels.AMFChannel;
   import mx.rpc.events.FaultEvent;
   import mx.rpc.remoting.mxml.RemoteObject;

   public class GenericService extends RemoteObject
   {
      public function GenericService()
      {
        super();
        var channel:ChannelSet=new ChannelSet();
        var amfChannel:AMFChannel=new AMFChannel("my-amf","http://localhost:8080/Servicios/messagebroker/amf");
       channel.addChannel(amfChannel);
       this.channelSet=channel;               
       this.addEventListener(FaultEvent.FAULT,onFault);
       }           
       public function onFault(event:FaultEvent):void
       {                  
          Alert.show( "Error comunicando con "+this.destination+
                      " \nDetalle:"+event.fault.message);         
       }
            
    }
}